$(function () {
    var $userTableForm = $(".user-table-form");
    var settings = {
        url: ctx + "messageNotice/messageHistoryList",
        pageSize: 10,
        queryParams: function (params) {
            return {
                pageSize: params.limit,
                pageNum: params.offset / params.limit + 1,
/*                                id: $userTableForm.find("input[name='id']").val(),
                                //busCompany: $userTableForm.find("input[name='busCompany']").val(),
                                paymentChannels: $userTableForm.find("select[name='selectPaymentChannels']").val(),
                                complaintType: $userTableForm.find("select[name='selectComplaintType']").val(),
                                processing: $userTableForm.find("select[name='selectProcessing']").val(),
                                complaintChannels: $userTableForm.find("select[name='selectComplaintChannels']").val(),
                                dutyDetermine: $userTableForm.find("select[name='selectDutyDetermine']").val(),
                                startTime: $userTableForm.find("input[name='startTime']").val(),
                                endTime: $userTableForm.find("input[name='endTime']").val(),
                                startTime1: $userTableForm.find("input[name='startTime1']").val(),
                                endTime1: $userTableForm.find("input[name='endTime1']").val(),
                                handler: $userTableForm.find("input[name='handler']").val(),
                                contactInformation: $userTableForm.find("input[name='contactInformation']").val(),
                                first: $("input[name='first']").val()*/
            };
        },
        columns: [{
            field: 'id',
            title: '短信通知编号',
        }, {
            field: 'messageNoticeTime',
            title: '通知时间'
        }, {
            field: 'messageNoticeTitle',
            title: '通知标题'
        },{
            field: 'messageNoticeValue',
            title: '通知内容',
            cellStyle:formatTableUnit,
            formatter:paramsMatter
        }, {
            field: 'phone',
            title: '通知电话'
        }, {
            field: 'name',
            title: '操作人'
            },{
            field: 'remarks',
            title: '备注',
            cellStyle:formatTableUnit,
            formatter:paramsMatter
        }
        ]
    };
    $MB.initTable('userTable', settings);
});
//表格超出宽度鼠标悬停显示td内容
function paramsMatter(value,row,index, field) {
    var span=document.createElement('span');
    span.setAttribute('title',value);
    span.innerHTML = value;
    return span.outerHTML;
}
//td宽度以及内容超过宽度隐藏
function formatTableUnit(value, row, index) {
    return {
        css: {
            "white-space": 'nowrap',
            "text-overflow": 'ellipsis',
            "overflow": 'hidden',
            "max-width":"150px"
        }
    }
}
